﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

using DotNetUI.Controls;

using Microsoft.Extensions.DependencyInjection;

using Xc.Logics.AepCoap;
using Xc.Views.Core;

namespace Aep平台设备导入软件
{
    /// <summary>
    /// App.xaml 的交互逻辑
    /// </summary>
    public partial class App : Application
    {
        public App() { DispatcherUnhandledException += App_DispatcherUnhandledException; }

        private void App_DispatcherUnhandledException(
            object sender,
            System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
        { MessageBox.Show(e.Exception.Message); }

        protected override void OnStartup(StartupEventArgs e)
        {
            DotNetWindow window = new DotNetWindow();
            window.Content = new StartUp().GetMainElement<Xc.Logics.AepCoap.Views.MainView>();
            window.SetTitle<DotNetWindow>("AEP设备导入工具").SetSizePercent(0.8).SetWindowStartupLocation(WindowStartupLocation.CenterScreen);
            window.ShowDialog();
            base.OnStartup(e);
        }
    }
}
